const mongoose = require("mongoose")

const UserSchema = mongoose.Schema({
  // 用户id
  userId: {
    type: String,
    require: true,
    default: "",
  },
  // 用户名
  username: {
    type: String,
    require: true,
  },
  // 密码
  password: {
    type: String,
    require: true,
  },
  // 手机号
  phone: {
    type: Number,
    require: true,
  },
  // 头像
  avatar: {
    type: String,
    default: null,
  },
  //身份证
  identitycard: {
    type: String,
    // required: true,
  },
  //性别
  gender: {
    type: String,
    require: true,
  },
  // 年龄
  age: {
    type: Number,
    require: true,
  },
  // 地址
  hometown: {
    type: String,
    default: "广东广州",
  },
  // 职业
  industry: {
    type: String,
    default: null,
  },
  // 爱好
  hobby: {
    type: String,
  },
  // 是否为房东
  isAdmin: {
    type: Boolean,
    require: true,
    default: false,
  },
  // 优惠券
  coupon: Array,
});

const User = mongoose.model("user", UserSchema);

module.exports = User